<template>
	<view class="swiper-box">
		<swiper class="swiper" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
			<swiper-item v-for="(item,index) in goodsList" :key="index">
				<image class="image" :src="$urlPrefix+item.mainImages[0]" @click="toGoodsDetail(item.id)" mode="scaleToFill"></image>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	export default {
		props:{
			goodsList:{
				type:Array
			}
		},
		name:"store-detail-swiper",
		data() {
			return {
				
			};
		},
		methods:{
			toGoodsDetail(id){
				uni.navigateTo({
					url:"/pages/goods-detail/goods-detail?id="+id
				})
			}
		}
	}
</script>

<style lang="scss">
	.swiper-box{
		.swiper{
			width: 750rpx;
			height: 562rpx;
			padding: 0 5rpx;
			box-sizing: border-box;
			.image{
				width: 100%;
				height: 100%;
			}
		}
	}
</style>
